<%--
  Created by IntelliJ IDEA.
  User: 13437
  Date: 2023/9/4
  Time: 14:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>菜谱预览</title>
    <link rel="stylesheet" href="/static/plugins/layui2.7.6/css/layui.css">
    <script src="/static/plugins/jquery-3.4.1.min.js"></script>
    <script>
        $.get('/menutype',function (d) {
            // i 代表集合的索引 , e 代表集合对象
             $(d).each(function (i,e) {
                 if (e.id == 3) {
                     $("#sel").append("<option selected value="+e.id+">"+e.name+"</option>");
                 }
                 else {
                     $("#sel").append("<option value="+e.id+">"+e.name+"</option>");
                 }
                // $("#sel").append("<option checked value="+e.id+">"+e.name+"</option>");

             });
        },'json');
    </script>
</head>
<body>



<div class="layui-layout layui-layout-admin">


    <%--头部与左侧样式--%>
    <jsp:include page="../commons/head.jsp"/>

    <div class="layui-body">





        <!-- 内容主体区域 -->
        <div style="padding: 15px;">

            <div class="layui-row">

                <div class="layui-col-md4 layui-col-md-offset2">
                    <img src="" alt="">
                </div>

                <div class="layui-col-md4 layui-col-md-offset2">
                    价格 <input type="text" id="price" name="price">
                    <br>
<%--                    类型 <select name="menuType" id="menuType"></select>--%>
                    类型 <select name="sel" id="sel"></select>
                    <br>
                    备注 <textarea name="remark" id="remark" cols="30" rows="10"></textarea>
                </div>

            </div>
            <br><br><br><br><br>
            <div class="layui-row">
                <c:if test="${pageNow > 1}"><a href="/menu/findByPage?pageNow=${pageNow - 1}">上一页</a></c:if>

                <c:forEach var="i"  begin="1" end="${totalPage / 2  + 1}">
                    <a href="/menu/findByPage?pageNow=${i}">${i}</a>
                </c:forEach>


                <c:if test="${pageNow < totalPage}"><a href="/menu/findByPage?pageNow=${pageNow + 1}">下一页</a></c:if>

                一共 ${totalPage} 页
                ,
                到第
                <form action="/menu/findByPage" method="get" style="display: inline">
                    <input type="text" name="pageNow" style="width: 30px" > 页

                    <button type="submit">确定</button>
                </form>
            </div>

        </div>
    </div>

    <%--引入底部样式--%>
    <jsp:include page="../commons/footer.jsp"/>


</div>

<script src="/static/plugins/layui2.7.6/layui.js"></script>
<script>
    layui.use(['element', 'layer', 'util', 'carousel','upload','table','form'], function () {
        var element = layui.element
            , layer = layui.layer
            , util = layui.util
            , $ = layui.$;
        var carousel = layui.carousel;
        var upload = layui.upload;
        var table = layui.table;
        var form = layui.form;
    });
</script>




</body>
</html>
